package com.ge.myoned.controller;

import com.ge.myoned.rabbitmq.MessageSender;
import com.ge.mytestparent.dto.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author geqingxiang
 * @PackageName myProject
 * @Package com.ge.oned.controller
 * @Date 2023/6/8 9:45
 * @Version 1.0
 */
@Tag(name = "消息队列", description = "RabbitMQ")
@RestController
@RequestMapping("mqTest")
public class RabbitMQController {

    @Autowired
    public MessageSender messageSender;

    @Operation(summary = "死信队列测试")
    @GetMapping("/send")
    public Result<?> send(@Parameter(name = "msg", description = "消息数据")String msg, @Parameter(name = "time", description = "时间秒")Integer time){
        messageSender.send(msg,time);
        return Result.success();
    }

}
